//
//  ShareButton.m
//  CarTown
//
//  Created by xionghao on 15/8/10.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "ShareButton.h"

@implementation ShareButton

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self.titleLabel.textAlignment=NSTextAlignmentCenter;
    }
    return self;
}

-(CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat x=(contentRect.size.width-48)/2;
    CGFloat y=8;
    CGFloat width=48;
    CGFloat height=48;
    return CGRectMake(x, y, width, height);
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat x=0;
    CGFloat y=56;
    CGFloat height=24;
    CGFloat width=contentRect.size.width;
    return CGRectMake(x, y, width, height);
}

@end
